]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
build: Add option to turn off tests
authorFlorian Müllner <fmuellner@gnome.org>
Sun, 5 Sep 2021 22:57:33 +0000 (00:57 +0200)
committerMarge Bot <marge-bot@gnome.org>
Tue, 7 Sep 2021 12:53:47 +0000 (12:53 +0000)
St's theme test now requires the libmutter-test library, which is only
built when tests are enabled. Instead of mandating a particular build
configuration in mutter, add a corresponding option in gnome-shell as
well.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1975>

meson.build
meson_options.txt
src/st/meson.build

index 7062e7d1072f3584a832620cd30f5abb72e4c675..9612d9f2476b21ed03362d471a362ec3e6e6ea2e 100644 (file)
@@ -88,7 +88,6 @@ clutter_dep = dependency(clutter_pc, version: mutter_req)
 cogl_dep = dependency(cogl_pc, version: mutter_req)
 cogl_pango_dep = dependency(cogl_pango_pc, version: mutter_req)
 mutter_dep = dependency(libmutter_pc, version: mutter_req)
-mutter_test_dep = dependency(libmutter_test_pc, version: mutter_req)
 polkit_dep = dependency('polkit-agent-1', version: polkit_req)
 startup_dep = dependency('libstartup-notification-1.0', version: startup_req)
 ibus_dep = dependency('ibus-1.0', version: ibus_req)
@@ -288,9 +287,12 @@ subdir('js')
 subdir('src')
 subdir('po')
 subdir('data')
-subdir('tests')
 subdir('tools')
 
+if get_option('tests')
+  subdir('tests')
+endif
+
 if get_option('gtk_doc')
   subdir('docs/reference')
 endif
index be9aa21f36c28cdd9178b69a7da889629fe97b1e..f0f2ecf6c32b33b1fb3bd826e7ebee5486a5e491 100644 (file)
@@ -22,6 +22,12 @@ option('man',
   description: 'Generate man pages'
 )
 
+option('tests',
+  type: 'boolean',
+  value: true,
+  description: 'Enable tests'
+)
+
 option('networkmanager',
   type: 'boolean',
   value: true,
index 8e4acdaaafc26e82e4594694b9f041330e36eea6..8004dfdbc18f5d16cb673448a4c2ace0a192c821 100644 (file)
@@ -191,17 +191,20 @@ libst_dep = declare_dependency(link_with: libst,
   sources: st_enums[1]
 )
 
-test_theme = executable('test-theme',
-  sources: 'test-theme.c',
-  c_args: st_cflags,
-  dependencies: [mutter_test_dep, gtk_dep, libxml_dep],
-  build_rpath: mutter_typelibdir,
-  link_with: libst
-)
-
-test('CSS styling support', test_theme,
-  workdir: meson.current_source_dir()
-)
+if get_option('tests')
+  mutter_test_dep = dependency(libmutter_test_pc, version: mutter_req)
+  test_theme = executable('test-theme',
+    sources: 'test-theme.c',
+    c_args: st_cflags,
+    dependencies: [mutter_test_dep, gtk_dep, libxml_dep],
+    build_rpath: mutter_typelibdir,
+    link_with: libst
+  )
+
+  test('CSS styling support', test_theme,
+    workdir: meson.current_source_dir()
+  )
+endif
 
 libst_gir = gnome.generate_gir(libst,
   sources: st_gir_sources,